package lium.lbs.lbsim.adapter

import android.support.v4.content.ContextCompat
import android.widget.ImageView
import android.widget.TextView
import com.buz.hjcdriver.bean.GroupMemberBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.lmlibrary.view.CircleImageView
import lium.lbs.lbsim.R
import lium.lbs.lbsim.activity.GroupDetailActivity
import lium.lbs.lbsim.jgchat.model.Constants

class GroupMemberAdapter : BaseQuickAdapter<GroupMemberBean, BaseViewHolder>(R.layout.item_groupmember_grid){
    override fun convert(helper: BaseViewHolder?, item: GroupMemberBean?) {
        if (item?.id.equals("11")&&item?.head.equals("11")&&item?.name.equals("11")){
            helper?.getView<CircleImageView>(R.id.group_member_header)?.setImageResource(R.drawable.icon_yaoqing)
            helper?.getView<TextView>(R.id.group_member_name)?.text = "邀请"
            helper?.getView<TextView>(R.id.group_member_name)?.setTextColor(ContextCompat.getColor(mContext,R.color.colorPrimary))
        } else{
            helper?.getView<TextView>(R.id.group_member_name)?.text = item?.name
            helper?.getView<TextView>(R.id.group_member_name)?.setTextColor(ContextCompat.getColor(mContext,R.color.colorPrimary))
            (mContext as GroupDetailActivity).displayImage(com.lmlibrary.Constants.Host_Pic + item?.head,R.drawable.jmui_head_icon,helper?.getView<ImageView>(R.id.group_member_header))
        }

    }
}